package com.boc.ewr.util.file.enumeration;

import com.boc.ewr.business.entity.AcctClassAFdbk;
import com.boc.ewr.business.entity.AcctClassCFdbk;
import com.boc.ewr.business.entity.AcctUncaDtl;
import com.boc.ewr.business.service.impl.*;
import com.boc.ewr.clkIn.service.impl.CaDtdClkinServiceImpl;
import com.boc.ewr.outsrc.entity.OutsrcExpStlmtBatch;
import com.boc.ewr.outsrc.service.impl.OutsrcDailyProblemServiceImpl;
import com.boc.ewr.outsrc.service.impl.OutsrcNdrDtlServiceImpl;
import com.boc.ewr.outsrc.service.impl.OutsrcSptckProblemServiceImpl;
import com.boc.ewr.risk.service.impl.*;
import com.boc.ewr.work.service.impl.WorkOprateRecordServiceImpl;
import com.boc.ewr.work.service.impl.WorkRecordDtlServiceImpl;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.Optional;

@Slf4j
public enum ExportEnum {
    //《上门对账反馈清单》-A类账户	CA_DTD_FDBK_A
    CA_DTD_FDBK_A("", AcctClassAFdbk.class, "《上门对账反馈清单》-A类账户"),
    //《风险核查反馈清单》-C类账户	CA_RSKCK_FDBK_C
    CA_RSKCK_FDBK_C("", AcctClassCFdbk.class,"《风险核查反馈清单》-C类账户"),
    //未对账数据汇总表	CA_UNCA_ALL
    CA_UNCA_ALL("CUL1|CUL2|AEA3|ALUD17", CaUncaAllServiceImpl.class,"未对账数据汇总表"),
    //催收名单	CA_COLL_LIST
    CA_COLL_LIST("CUL1|CUL2", CaCollListServiceImpl.class, "催收名单"),
    //线上反馈的客户会话明细分类表	CA_CUSM_CALL_OLFDBK
    CA_CUSM_CALL_OLFDBK("", CaCusmCallOlfdbkServiceImpl.class,"线上反馈的客户会话明细分类表"),
    //特殊不对账账户申请	CA_UNPRIACC_APPLY
    CA_UNPRIACC_APPLY("", CaUnpriaccApplyServiceImpl.class,"特殊不对账账户申请"),
    //特殊不对账账户异动表/异动特殊不对账账户清单	CA_UNPRIACC_UNUSUAL
    CA_UNPRIACC_UNUSUAL("HAU8", CaUnpriaccUnusualServiceImpl.class,"特殊不对账账户异动表/异动特殊不对账账户清单"),
    //可剔除考核账户申请	ELMTB_ASSMT_APPLY
    ELMTB_ASSMT_APPLY("", ElmtbAssmtApplyServiceImpl.class,"可剔除考核账户申请"),
    //签约机构变更申请	SNORG_CHANGE_APPLY
    SNORG_CHANGE_APPLY("", SnorgChangeApplyServiceImpl.class,"签约机构变更申请"),
    //协议变更申请	PROTOCOL_CHANGE_APPLY
    PROTOCOL_CHANGE_APPLY("", ProtocolChangeApplyServiceImpl.class,"协议变更申请"),
    //D2类账户申请	ACCT_D2_APPLY  2023.06.13 会议移除该功能
    // ACCT_D2_APPLY("", AcctD2ApplyServiceImpl.class,"D2类账户申请"),
    //《条线考核数据汇总》	EWR_RECEIPT_RATIO、EWR_MANAGE_EXAM
//    LINE_ACCESS_LIST("CRL12", LineAccessListServiceImpl.class,"条线考核数据汇总"),
    EWR_RECEIPT_RATIO("CBD6|CRL12", EwrReceiptRatioServiceImpl.class,"对账指标考核数据汇总"),
//    EWR_MANAGE_EXAM("CBD6|CRL12", EwrManageExamServiceImpl.class,"对账管理考核数据汇总"),
    //问题提示-协议清单	PRO_PRBSD_LIST,通过定时任务，从PRO获取推送，不需要从批量导入中生成
//    PRO_PRBSD_LIST("", ProPrbsdListServiceImpl.class,"问题提示-协议清单"),
    //内网对账数据反馈清单	INTRANET_CA_FDBK
    INTRANET_CA_FDBK("ICF26", IntranetCaFdbkServiceImpl.class,"内网对账数据反馈清单"),
    //外网对账数据反馈清单	EXTRANET_CA_FDBK
    EXTRANET_CA_FDBK("CEL13|MAR14", ExtranetCaFdbkServiceImpl.class,"外网对账数据反馈清单"),
    //对账印鉴不符清单	SIGN_MISMATCH_FDBK
    SIGN_MISMATCH_FDBK("CBD6", SignMismatchFdbkServiceImpl.class,"对账印鉴不符清单"),
    //网银操作员不符清单	EBANK_OPRATE_MISMATCH_FDBK
    EBANK_OPRATE_MISMATCH_FDBK("CET15", EbankOprateMismatchFdbkServiceImpl.class,"网银操作员不符清单"),
    //员工代客清单	EMP_BRK_FDBK
    EMP_BRK_FDBK("HEI18", EmpBrkFdbkServiceImpl.class,"员工代客清单"),
    //多次“验印不符”清单	SIGN_PLURAL_MISMATCH
    SIGN_PLURAL_MISMATCH("SMFL20", SignPluralMismatchServiceImpl.class,"多次“验印不符”清单"),
    //已注吊销账户清单	ACCT_RVKDED
    ACCT_RVKDED("QBI25_1", AcctRvkdedServiceImpl.class,"已注吊销账户清单"),
    //待处理无效账单清单	PEND_CA_INVALID
    PEND_CA_INVALID("", PendCaInvalidServiceImpl.class,"待处理无效账单清单"),
    //工作记录明细	WORK_RECORD_DTL
    WORK_RECORD_DTL("", WorkRecordDtlServiceImpl.class,"工作记录明细"),
    //工作日志（操作记录）	WORK_OPRATE_RECORD
    WORK_OPRATE_RECORD("", WorkOprateRecordServiceImpl.class,"工作日志（操作记录）"),
    //外包公司日常问题清单	OUTSRC_DAILY_PROBLEM
//    OUTSRC_DAILY_PROBLEM("", OutsrcDailyProblemServiceImpl.class,"外包公司日常问题清单"),
    //退信明细（待确认信息清单）	OUTSRC_NDR_DTL
    OUTSRC_NDR_DTL("", OutsrcNdrDtlServiceImpl.class,"退信明细（待确认信息清单）"),
    //外包公司现场检查问题清单	OUTSRC_SPTCK_PROBLEM
    OUTSRC_SPTCK_PROBLEM("", OutsrcSptckProblemServiceImpl.class,"外包公司现场检查问题清单"),
    //外出上门对账打卡管理表	CA_DTD_CLKIN
    CA_DTD_CLKIN("", CaDtdClkinServiceImpl.class,"外出上门对账打卡管理表"),
    //A1类账户明细   CA_ACCT_DTL_A1
    CA_ACCT_DTL_A1("HLR27", AcctDtlClassA1ServiceImpl.class,"A1类账户明细"),
    //A2类账户明细   CA_ACCT_DTL_A2
    CA_ACCT_DTL_A2("CUL1|CUL2|HAEA10", AcctDtlClassA2ServiceImpl.class,"A2类账户明细"),
    //A3类账户明细   CA_ACCT_DTL_A3
    CA_ACCT_DTL_A3("CUL1|CUL2|HAEA10", AcctDtlClassA3ServiceImpl.class,"A3类账户明细"),
    //C类账户明细    CA_ACCT_DTL_C
    CA_ACCT_DTL_C("CUL1|CUL2|HAEA10", AcctDtlClassCServiceImpl.class,"C类账户明细"),
    //D类账户明细    CA_ACCT_DTL_D，D2类数据要额外生成
    CA_ACCT_DTL_D("CUL1|CUL2|HAEA10", AcctDtlClassDServiceImpl.class,"D类账户明细"),
    //未对账账户明细
    CA_UNCA_DTL("CUL1|CUL2|HAEA10", AcctUncaDtl.class,"未对账账户明细"),
    //费用结算（批量）
    OUTSRC_EXP_STLMT_BATCH("CRL12|CSD22", OutsrcExpStlmtBatch.class,"费用结算（批量）");

    private String index;
    private Class serviceName;
    private String TypeCN;

    ExportEnum(String index, Class serviceName, String TypeCN) {
        this.index = index;
        this.serviceName = serviceName;
        this.TypeCN = TypeCN;
    }

    /**
     * 根据code获取枚举对象
     *
     * @param code
     * @return
     */
    public static ExportEnum getByIndex(String code) {
        Optional<ExportEnum> first = Arrays.stream(ExportEnum.values()).filter(e -> e.getIndex().equals(code)).findFirst();
//        ExpEnum expEnum = first.get();
        ExportEnum expEnum = first.orElse(null);
        log.info("导出的文件类型是：" + expEnum.toString());
        return expEnum;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public Class getServiceName() {
        return serviceName;
    }

    public void setServiceName(Class serviceName) {
        this.serviceName = serviceName;
    }

    public String getTypeCN() {
        return TypeCN;
    }

    public void setTypeCN(String typeCN) {
        TypeCN = typeCN;
    }
}
